package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

/**
 * 2024/7/8-13:51
 * 功能:
 */
public interface OrderSettingMapper {
    @Select("select count(*) from t_ordersetting where orderDate = #{orderDate};")
    long findCountByOrderDate(Date orderDate);
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate};")
    void editNumberByOrderDate(OrderSetting orderSetting);
    @Insert("insert into t_ordersetting values (null, #{orderDate}, #{number}, #{reservations});")
    void add(OrderSetting orderSetting);
    @Select("select * from t_ordersetting where orderDate between #{begin} and #{end};")
    List<OrderSetting> getOrderSettingByMonth(Date begin, Date end);
}
